<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title></title>
	<link rel="stylesheet" href="./css/editormd.css" />
	
	<script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
	<script src="./editormd.min.js"></script>
</head>
<body>
	<div id="test-editor" style="width: 100%;height:400px;"></div>
</body>
</html>
<script>
    $(function() {
    	// editormd 容器id
        var editor = editormd("test-editor", {
            width  : "90%",//编辑器区域宽度,默认100%
            height : "300px",//编辑器区域高度,默认100%
            // theme: 'dark',//工具栏主题
            // editorTheme: 'pastel-on-dark',//编辑区域主题
            // previewTheme: 'dark',//预览区域主题
            // markdown: '请输入内容',//初始化内容
            codeFold: true,//码叠
            // syncScrolling : false,//是否同步显示,默认为true
            // watch : false,//是否显示预览区域,默认为true
            path: "./lib/", //资源路径

            imageUpload : true,//是否开启上传本地图片
            imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
            imageUploadURL: '/user/upload',//图片上传接口
            onload: function(){ //编辑器加载时执行
            	console.log('onload', this);
            }
        });
    });
</script>